<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/radardevice/devices/devicedetail.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/radardevice/devices/devicedetail.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '雷达管理',
                name: 'devices/devicedetail',
                url: "/devicedetail/",
                sortName: "updateTime"
            });
            const editFormFields = ref({"deviceNo":"","factorySettings":"","detectiontime":"","startDistance":"","endDistance":"","baudRate":"","sensitivity":"","beamWidth":"","normalThreshold":"","rangeThreshold":"","averageValue":"","biasValue":"","highValue":"","dacOutputLowest":"","dacOutputMax":"","trackingEnabled":"","targetFilter":"","sensorTemperature":"","alarmUpperLimit":"","alarmLowerLimit":"","surgeFiltration":"","updateTime":""});
            const editFormOptions = ref([[{"title":"设备编号","field":"deviceNo","disabled":true,"type":"text"}],
                              [{"dataKey":"FactorySettings","data":[],"title":"出厂设置","field":"factorySettings","type":"select"},
                               {"title":"检测时间(s)","field":"detectiontime","type":"number"}],
                              [{"title":"起始距离","field":"startDistance","type":"number"},
                               {"title":"结束距离","field":"endDistance","type":"number"},
                               {"dataKey":"baudRate","data":[],"title":"波特率","field":"baudRate","type":"select"}],
                              [{"title":"灵敏度","field":"sensitivity","type":"number"},
                               {"title":"波束宽度","field":"beamWidth","type":"number"},
                               {"title":"正常阈值","field":"normalThreshold","type":"decimal"}],
                              [{"title":"近距离阈值","field":"rangeThreshold","type":"decimal"},
                               {"title":"平均值","field":"averageValue","type":"number"},
                               {"title":"偏置值(mm)","field":"biasValue","type":"number"}],
                              [{"title":"液位空高值","field":"highValue","colSize":4,"type":"number"},
                               {"title":"DAC最低位","field":"dacOutputLowest","type":"number"},
                               {"title":"DAC最大值","field":"dacOutputMax","type":"number"}],
                              [{"dataKey":"trackingEnabled","data":[],"title":"启用追踪","field":"trackingEnabled","type":"select"},
                               {"dataKey":"targetFilter","data":[],"title":"目标过滤器","field":"targetFilter","type":"select"},
                               {"title":"传感器温度","field":"sensorTemperature","type":"decimal"}],
                              [{"title":"报警上限","field":"alarmUpperLimit","type":"number"},
                               {"title":"报警下限","field":"alarmLowerLimit","type":"number"},
                               {"dataKey":"IsItEnabled","data":[],"title":"浪涌过滤","field":"surgeFiltration","type":"select"}],
                              [{"title":"更新时间","field":"updateTime","disabled":true,"type":"datetime"}]]);
            const searchFormFields = ref({"deviceNo":"","factorySettings":""});
            const searchFormOptions = ref([[{"title":"设备编号","field":"deviceNo","type":"like"},{"dataKey":"FactorySettings","data":[],"title":"出厂设置","field":"factorySettings","type":"select"}]]);
            const columns = ref([{field:'id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'device_id',title:'设备ID',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'deviceNo',showOverflowTooltip:'true',title:'设备编号',type:'string',link:true,width:175,readonly:true,align:'left',sort:true},
                       {field:'factorySettings',title:'出厂设置',type:'int',bind:{ key:'FactorySettings',data:[]},width:120,align:'left'},
                       {field:'detectiontime',title:'检测时间(s)',type:'int',width:100,align:'left'},
                       {field:'softwareVersion',title:'软件版本号',type:'int',width:95,align:'left'},
                       {field:'sensorType',title:'传感器型号',type:'int',width:95,align:'left'},
                       {field:'startDistance',title:'起始距离',type:'int',width:110,align:'left'},
                       {field:'endDistance',title:'结束距离',type:'int',width:110,align:'left'},
                       {field:'baudRate',title:'波特率',type:'int',bind:{ key:'baudRate',data:[]},width:80,align:'left'},
                       {field:'sensitivity',title:'灵敏度',type:'int',width:80,align:'left'},
                       {field:'beamWidth',title:'波束宽度',type:'int',width:80,align:'left'},
                       {field:'normalThreshold',title:'正常阈值',type:'decimal',width:85,align:'left'},
                       {field:'rangeThreshold',title:'近距离阈值',type:'decimal',width:110,align:'left'},
                       {field:'averageValue',title:'平均值',type:'int',width:85,align:'left'},
                       {field:'biasValue',title:'偏置值(mm)',type:'int',width:100,align:'left'},
                       {field:'highValue',title:'液位空高值',type:'int',width:95,align:'left'},
                       {field:'dacOutputLowest',title:'DAC最低位',type:'int',width:95,align:'left'},
                       {field:'dacOutputMax',title:'DAC最大值',type:'int',width:95,align:'left'},
                       {field:'trackingEnabled',title:'启用追踪',type:'sbyte',bind:{ key:'trackingEnabled',data:[]},width:90,align:'left'},
                       {field:'targetFilter',title:'目标过滤器',type:'int',bind:{ key:'targetFilter',data:[]},width:90,align:'left'},
                       {field:'sensorTemperature',title:'传感器温度',type:'decimal',width:95,align:'left'},
                       {field:'alarmUpperLimit',title:'报警上限',type:'int',width:90,align:'left'},
                       {field:'alarmLowerLimit',title:'报警下限',type:'int',width:90,align:'left'},
                       {field:'updateTime',title:'更新时间',type:'datetime',sort:true,width:170,readonly:true,align:'left',sort:true},
                       {field:'surgeFiltration',title:'浪涌过滤',type:'int',bind:{ key:'IsItEnabled',data:[]},width:90,align:'left'},
                       {field:'CreateID',title:'设备所属用户',type:'int',width:120,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
